/*
 * Copyright (c) 2013, FPX and/or its affiliates. All rights reserved.
 * Use, Copy is subject to authorized license.
 */
package com.fpx.order.plat.bussiness.vo;

public class ResultVO {

    private boolean success;
    private String error;
    private String errorCode;
    private Object data;

    public ResultVO() {
    }

    private ResultVO(boolean success, String error, String errorCode, Object data) {
        super();
        this.success = success;
        this.error = error;
        this.errorCode = errorCode;
        this.data = data;
    }

    public static ResultVO ok(Object data) {
        return new ResultVO(true, null, null, data);
    }

    public static ResultVO fail(String errorCode, String error) {
        return new ResultVO(false, error, errorCode, null);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
